package com.hotel_management_backstage.lin.service;

import com.hotel_management_backstage.lin.dao.SysUserRoleMapper;
import com.hotel_management_backstage.lin.entity.SysUserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysUserRoleService {
    @Autowired
    private SysUserRoleMapper userRoleMapper;

    public List<SysUserRole> listByUserId(Integer userId) {
        return userRoleMapper.listByUserId(userId);
    }

    public void insertUserRole(Integer userId, Integer roleId){
        userRoleMapper.insertUserRole(userId,roleId);
    }

    public SysUserRole selectByUserId(Integer userId){
        return userRoleMapper.selectByUserId(userId);
    }

    public void deleteSysUserRoleByUserId(Integer userId){
        userRoleMapper.deleteSysUserRoleByUserId(userId);
    }
}
